
package com.cbwl.eoas.cms.model.sysconfig;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;


/**
 * 
 * <p>[描述信息：说明类的基本功能]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年10月20日 下午5:22:30
 */
public class DictDetailDTO extends CommonBean {

	private static final long serialVersionUID = 2398692262788775752L;
	private java.lang.Long id;
	@NotBlank @Length(max=32)
	private java.lang.String dictTypeNo;
	@NotBlank @Length(max=32)
	private java.lang.String dictNo;
	@NotBlank @Length(max=128)
	private java.lang.String dictName;
	@Length(max=16)
	private java.lang.String dictValue1;
	@Length(max=32)
	private java.lang.String dictValue2;
	@Length(max=64)
	private java.lang.String dictValue3;
	
	private java.lang.Integer orderNo;
	@NotBlank @Length(max=5)
	private java.lang.String dictStatus;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	//columns END
	private String dictStatusName;
	
	private String dictTypeName;
	
	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setDictTypeNo(java.lang.String value) {
		this.dictTypeNo = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.dictTypeName = redisValue;
			}
		}
	}
	
	public java.lang.String getDictTypeNo() {
		return this.dictTypeNo;
	}
	
	public void setDictNo(java.lang.String value) {
		this.dictNo = value;
	}
	
	public java.lang.String getDictNo() {
		return this.dictNo;
	}
	
	public void setDictName(java.lang.String value) {
		this.dictName = value;
	}
	
	public java.lang.String getDictName() {
		return this.dictName;
	}
	
	public void setDictValue1(java.lang.String value) {
		this.dictValue1 = value;
	}
	
	public java.lang.String getDictValue1() {
		return this.dictValue1;
	}
	
	public void setDictValue2(java.lang.String value) {
		this.dictValue2 = value;
	}
	
	public java.lang.String getDictValue2() {
		return this.dictValue2;
	}
	
	public void setDictValue3(java.lang.String value) {
		this.dictValue3 = value;
	}
	
	public java.lang.String getDictValue3() {
		return this.dictValue3;
	}
	
	public void setOrderNo(java.lang.Integer value) {
		this.orderNo = value;
	}
	
	public java.lang.Integer getOrderNo() {
		return this.orderNo;
	}
	
	public void setDictStatus(java.lang.String value) {
		this.dictStatus = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.dictStatusName = redisValue;
			}
		}
	}
	
	public java.lang.String getDictStatus() {
		return this.dictStatus;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	
	public String getDictStatusName() {
		return dictStatusName;
	}
	
	public void setDictStatusName(String dictStatusName) {
		this.dictStatusName = dictStatusName;
	}
	
	public String getDictTypeName() {
		return dictTypeName;
	}

	
	public void setDictTypeName(String dictTypeName) {
		this.dictTypeName = dictTypeName;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("DictTypeNo",getDictTypeNo())
			.append("DictNo",getDictNo())
			.append("DictName",getDictName())
			.append("DictValue1",getDictValue1())
			.append("DictValue2",getDictValue2())
			.append("DictValue3",getDictValue3())
			.append("OrderNo",getOrderNo())
			.append("DictStatus",getDictStatus())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof DictDetailDTO == false){return false;}
		if(this == obj){return true;}
		DictDetailDTO other = (DictDetailDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

